#ifndef TREEDRAW_H
#define TREEDRAW_H
#include "common.h"
#include "GL/glu.h"
#include "treegen.h"
#include "treegen2d.h"
#include "qglshaderprogram.h"

#include "qgl.h"

class TreeGen2D;

class TreeDraw
{
public:
    TreeDraw();
    void drawTree(TreeGen2D * treegen);
    void animateTree();
    GLuint leaf, flower;
    QGLShaderProgram *m_leaf;

private:
    void recurDraw(Bud *bud);
    void recurDrawLeaf(Bud *bud);
    void drawInterNode(Bud *bud);
    void drawLeaf(Bud *bud);
    void drawFlower(Bud *bud);
    void drawBud(Bud *bud);
    void drawFlower();
         GLUquadric *mQuadric;

     GLuint loadTexture(const QString &filename);

};

#endif // TREEDRAW_H
